package com.englisheveryday.constants;

/**
 * <pre>
 *   常量
 * </pre>
 * @author 马永华
 * @date 2012-10-12 下午4:04:43
 * @version 1.1
 */

public class Constants {

	public static final int FILEDOWNLOAD_STATUS_FINISH = 0;
	public static final int FILEDOWNLOAD_STATUS_SUCCESS = 1;
	public static final int FILEDOWNLOAD_STATUS_FAILURE = 2;

	public static final int FILEANALYSIS_STATUS_FINISH = 3;
	
	public static final int FILENOWNLOAD_STATUS_OVER = 6;
	
	public static final int SYSTEM_INIT_FINISH = 8;
	public static final int SYSTEM_INIT_ERROR = 9;
	
	public static final int SYSTEM_FEEDBACK_SUCCESS = 10;
	public static final int SYSTEM_FEEDBACK_FAILURE = 11;
	
	public static final int SYSTEM_CHECKUPDATE_NOUPDATE = 12;
	public static final int SYSTEM_CHECKUPDATE_HASUPDATE = 13;
	
	public static final int HANDLER_DATA_LOADED = 14;
	public static final int HANDLER_DATA_SYNC = 15;
	public static final int HANDLER_DATA_LOADING_STOP = 16;
	public static final int HANDLER_DATA_NODATA = 17;
	public static final int HANDLER_DATA_NETWORKNOTAVAILABLE = 18;
	public static final int HANDLER_DATA_RESYNC = 19;
	
	public static final int HANDLER_PLAYLIST_LOADED = 20;
	public static final int HANDLER_PLAYLIST_CHECKED = 21;
	
	public static final int PLAYER_OPERATE_PLAY = 22;
	public static final int PLAYER_OPERATE_PRE = 23;
	public static final int PLAYER_OPERATE_NEXT = 24;
	public static final int PLAYER_OPERATE_PAUSE = 25;
	public static final int PLAYER_OPERATE_STOP = 26;
	public static final int PLAYER_OPERATE_RESTART = 27;
	
	public static final int PLAYER_MODE_SINGLER = 28;
	public static final int PLAYER_MODE_ORDER = 29;
	
	public static final String SYNC_STATUS_READTIMEOUT = "timeout";
	public static final String SYNC_STATUS_FAILURE = "failure";
	public static final String SYNC_STATUS_SUCCESS ="success";
	public static final String SYNC_STATUS_NODATA = "nodata";
	
	//ANCHOR TYPE
	public static final String ANCHOR_ARTICLE = "0";
	public static final String ANCHOR_CATEGORY = "1";
	
	public static final String URL = "http://192.168.1.104:8080/englisheveryday/";
//	public static final String URL = "http://api.7colorstyle.com/";
	public static final String BASEDIR = "/sdcard/englisheveryday/";
	public static final String SETTING_PLAYER  = "file_playtime";
	
	
	//article
	public static final String SELECTCOUNTID = "select id from article";
//	public static final String ARTICLE_SELECT_PAGE_SQL = "select * from article a  limit ?,? ";
	public static final String ARTICLE_SELECT_PAGE_SQL = "select a.id,a.title,a.englishtext,a.audio,a.mark,a.createtime,c.name as categoryname from article a left join category c on a.category = c.id limit ?,? ";
	public static final String ARTICLE_SELECT_BY_ID = "select id from article where id = ?";
	public static final String ARTICLE_IS_MARK = "select id from article where mark = '1' and id = ?";
	
	//category
	public static final String CATEGORY_SELECT_BY_ID = "select id from category where id = ?";
	public static final String CATEGORY_SELECT_ALL = "select * from category";
	
	//playlist
	public static final String PLAYLIST_SELECT_SQL = "select p.*,a.title,a.audio from playlist p,article a where p.articleid = a.id";
	public static final String PLAYLIST_SELECT_BY_ID = "select p.*,a.audio,a.title from playlist p,article a where p.id = ? and p.articleid = a.id";
	public static final String PLAYLIST_SELECT_NEXT = "select p.*,a.audio,a.title from playlist p,article a where p.rowid > (select p1.rowid from playlist p1 where p1.id = ?) and p.articleid = a.id  order by p.rowid limit 0,1";
	public static final String PLAYLIST_SELECT_PRE = "select p.*,a.audio,a.title from playlist p,article a where p.rowid < (select p1.rowid from playlist p1 where p1.id = ?) and p.articleid = a.id  order by p.rowid desc limit 0,1";
	public static final String PLAYLIST_SELECT_FIRST = "select p.*,a.audio,a.title from playlist p,article a where p.rowid = (select min(p.rowid) from playlist p)";
	public static final String PLAYLIST_SELECT_LAST = "select p.*,a.audio,a.title from playlist p,article a where p.rowid = (select max(p.rowid) from playlist p)";
	public static final String PLAYLIST_SELECT_COUNT = "select count(id) as num from playlist";
	public static final String PLAYLIST_COUNTSELECT = "select id from playlist where articleid = ?";
}

